package com.logica.tutorial.dto;

import java.io.Serializable;
import com.logica.tutorial.model.Person;
import com.logica.tutorial.model.Sex;

public class PersonDTO implements Serializable {

	private static final long serialVersionUID = -7046613756280007888L;
	
	private Long personId;
	private Sex sex = Sex.NA;
	private String firstName;
	private String lastName;
	private AddressDTO address;
	private Long father;
	private Long mother;
	//private Collection<Person> children;
	//private Collection<Person> friends;
	//private Collection<Person> friendOf;

	public PersonDTO(Person person) {
		this.personId = person.getId();
		this.sex = person.getSex();
		this.firstName = person.getFirstName();
		this.lastName = person.getLastName();
		if(person.getAddress()!=null)
			this.address = new AddressDTO(person.getAddress());
		if(person.getMother()!=null)
			this.setMother(person.getMother().getId());
		if(person.getFather()!=null)
			this.setFather(person.getFather().getId());
		//this.setChildren(person.getChildren());
		//this.friends = person.getFriends();
		//this.friendOf = person.getFriendOf();
	}
	
	public Long getId() {
		return personId;
	}

	public void setId(Long id) {
		this.personId = id;
	}

	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex sex) {
		this.sex = sex;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public AddressDTO getAddress() {
		return address;
	}

	public void setAddress(AddressDTO address) {
		this.address = address;
	}

	public Long getFather() {
		return father;
	}

	public void setFather(Long father) {
		this.father = father;
	}

	public Long getMother() {
		return mother;
	}

	public void setMother(Long mother) {
		this.mother = mother;
	}

//	public Person getFather() {
//		return father;
//	}
//
//	public void setFather(Person father) {
//		this.father = father;
//	}
//
//	public Person getMother() {
//		return mother;
//	}
//
//	public void setMother(Person mother) {
//		this.mother = mother;
//	}
//
//	public Collection<Person> getChildren() {
//		return children;
//	}
//
//	public void setChildren(Collection<Person> children) {
//		this.children = children;
//	}
//
//	public void setFriends(Collection<Person> friends) {
//		this.friends = friends;
//	}
//
//	public Collection<Person> getFriends() {
//		return friends;
//	}
//
//	public void setFriendOf(Collection<Person> friendOf) {
//		this.friendOf = friendOf;
//	}
//
//	public Collection<Person> getFriendOf() {
//		return friendOf;
//	}
}
